package com.scau.meetingbook.service.impl;

import com.scau.meetingbook.pojo.PaymentRecord;
import com.scau.meetingbook.mapper.PaymentRecordMapper;
import com.scau.meetingbook.service.PaymentRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.scau.meetingbook.vo.ResultVO;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;


import java.util.List;

@Service
public class PaymentRecordServiceImpl extends ServiceImpl<PaymentRecordMapper, PaymentRecord> implements PaymentRecordService {

    @Autowired
    private PaymentRecordMapper paymentRecordMapper;

    @Override
    public ResultVO insertPaymentRecord(PaymentRecord paymentRecord) throws Exception {
        paymentRecordMapper.insert(paymentRecord);
        return ResultVO.success(null);
    }

    @Override
    public ResultVO<PaymentRecord> getPaymentRecordById(Integer id) throws Exception {
        return ResultVO.success(null, paymentRecordMapper.selectById(id));
    }

    @Override
    public ResultVO updatePaymentRecordById(PaymentRecord paymentRecord) throws Exception {
        paymentRecordMapper.updateById(paymentRecord);
        return ResultVO.success(null);
    }

    @Override
    public ResultVO deletePaymentRecordById(Integer id) throws Exception {
        paymentRecordMapper.deleteById(id);
        return ResultVO.success(null);
    }
}